package StudyCode.summary.mydatetime;

import java.time.LocalDate;
import java.time.Month;
import java.time.Period;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class PeriodBetweenDates {
	public static void main(String[] args) {
		LocalDate anniversary = LocalDate.of(2000, Month.NOVEMBER, 11);
		LocalDate today = LocalDate.now();
		Period period = Period.between(anniversary, today);
		System.out.println("相差天数: " + period.getDays());
		System.out.println("相差月数: " + period.getMonths());
		System.out.println("相差年数: " + period.getYears());
	}
}
